package com.impress.service;

import com.impress.model.Feed;
import com.impress.model.Item;
import com.impress.provider.FeedData;

import android.content.Context;

public class FeedService {
	
	public static synchronized boolean markAllAsRead(Context context, Feed feed){
		if(feed==null || feed.items == null){
			return false;
		}
		ItemService itemService = new ItemService(context);
		for (Item item : feed.items) {
			itemService.updateItemState(item, FeedData.Items.READ_STATE_PENDING, 1);
			item.setReadStatePending(1);
		}
		return true;
	}
}
